from django.http import HttpResponse

def page_2003_view(request):
    html = "<h1>这是2003页面</h>"
    return HttpResponse(html)

def index_view(request):
    html = "<h1>这是首页页面</h>"
    return HttpResponse(html)

def page1_view(request):
    html = "<h1>这是编号为1的页面</h>"
    return HttpResponse(html)

def page2_view(request):
    html = "<h1>这是编号为2的页面</h>"
    return HttpResponse(html)

def pagon_view(request,pg):
    html = '这是编号为%s的网页'%(pg)
    return HttpResponse(html)

def cal_views(request,n,op,m):
    if op not in ['add','sub','mul']:
        return HttpResponse('你的操作错误,请输入：add、sub或者mul')
    #判断用户输入
    result = 0
    if op == 'add':
        result = n + m
    elif op == 'sub':
        result = n - m
    elif op == 'mul':
        result = n * m
    # 返回最终结果
    return HttpResponse('结果为：%s'%(result))

def cal2_view(request,x,op,y):
    html = 'x:%s op:%s y:%s'%(x,op,y)
    return HttpResponse(html)

def birthday_view(request,y,m,d):
    html = "生日为%s年%s月%s日"%(y,m,d)
    return HttpResponse(html)







